import 'package:logger/logger.dart';
import 'package:series_play/utils/logger_utils.dart';

class Log {
  static void init({Level level = Level.debug, bool enable = true}) {
    LoggerUtils.instance.config(level: level, enable: enable);
  }

  static void v(dynamic message, [dynamic error, StackTrace? stackTrace]) {
    LoggerUtils.instance.v(message, error, stackTrace);
  }

  static void d(dynamic message, [dynamic error, StackTrace? stackTrace]) {
    LoggerUtils.instance.d(message, error, stackTrace);
  }

  static void i(dynamic message, [dynamic error, StackTrace? stackTrace]) {
    LoggerUtils.instance.i(message, error, stackTrace);
  }

  static void w(dynamic message, [dynamic error, StackTrace? stackTrace]) {
    LoggerUtils.instance.w(message, error, stackTrace);
  }

  static void e(dynamic message, [dynamic error, StackTrace? stackTrace]) {
    LoggerUtils.instance.e(message, error, stackTrace);
  }

  static void wtf(dynamic message, [dynamic error, StackTrace? stackTrace]) {
    LoggerUtils.instance.wtf(message, error, stackTrace);
  }

  static void network(
    String url, {
    String method = 'GET',
    dynamic data,
    dynamic response,
  }) {
    LoggerUtils.instance.network(
      url,
      method: method,
      data: data,
      response: response,
    );
  }

  static void api(
    String path,
    int statusCode,
    dynamic data, {
    String method = 'GET',
  }) {
    LoggerUtils.instance.apiResponse(path, statusCode, data, method: method);
  }

  static void performance(String tag, Duration duration) {
    LoggerUtils.instance.performance(tag, duration);
  }

  static void object(String tag, dynamic object) {
    LoggerUtils.instance.printObject(tag, object);
  }
}
